var t = require;
var e = module;
var o = exports;
var a,
    i =
        (this && this.__extends) ||
        ((a = function (t, e) {
            return (a =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (t, e) {
                        t.__proto__ = e;
                    }) ||
                function (t, e) {
                    for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                })(t, e);
        }),
        function (t, e) {
            a(t, e);
            function o() {
                this.constructor = t;
            }
            t.prototype = null === e ? Object.create(e) : ((o.prototype = e.prototype), new o());
        }),
    n =
        (this && this.__decorate) ||
        function (t, e, o, a) {
            var i,
                n = arguments.length,
                r = n < 3 ? e : null === a ? (a = Object.getOwnPropertyDescriptor(e, o)) : a;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, a);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (i = t[s]) && (r = (n < 3 ? i(r) : n > 3 ? i(e, o, r) : i(e, o)) || r);
            return n > 3 && r && Object.defineProperty(e, o, r), r;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var r = t("NodeKindItem"),
    s = t("StarNodeCom"),
    c = cc._decorator,
    p = c.ccclass,
    l = c.property,
    d =
        (c.menu,
        (function (t) {
            i(e, t);
            function e() {
                var e = (null !== t && t.apply(this, arguments)) || this;
                e.iconSprite = null;
                e.bgLine = null;
                e.bgSprite = null;
                e.levelLab = null;
                e.maskNode = null;
                e.redNode = null;
                e.wearNode = null;
                e.drakView = null;
                e.nodeKindItem = null;
                e.starListCom = null;
                e.redTag = !1;
                e.tag = "";
                e.id = "";
                e.typeIndex = 0;
                return e;
            }
            e.prototype.onLoad = function () {
                this.node.on(cc.Node.EventType.TOUCH_END, this.clickItem, this);
                this.maskNode.on(cc.Node.EventType.TOUCH_END, this.maskNodeEv, this);
                this.maskNode.active = !1;
                EVUIEffView.on(EVUIEffView.viewBoxMask, this.maskSet.bind(this), this);
                EVUIEffView.on(EVUIEffView.setViewBool, this.maskSetBool.bind(this), this);
            };
            e.prototype.maskSetBool = function (t, e, o, a) {
                if (e == this.tag) {
                    var i = o.indexOf(this.id) >= 0;
                    this.drakView.active = i == a;
                }
            };
            e.prototype.resetView = function () {
                this.redTag = !1;
                this.maskNode.active = !1;
                this.drakView.active = !1;
                this.redNode && (this.redNode.active = !1);
                this.wearNode && (this.wearNode.active = !1);
            };
            e.prototype.openWear = function () {
                this.wearNode && (this.wearNode.active = !0);
            };
            e.prototype.openRed = function () {
                this.redNode && (this.redNode.active = !0);
            };
            e.prototype.maskSet = function (t, e, o, a) {
                if (e == this.tag) {
                    var i = o.indexOf(this.id) >= 0;
                    this.maskNode.active = i == a;
                }
            };
            e.prototype.maskNodeEv = function () {};
            e.prototype.onDestroy = function () {
                EVUIEffView.offTarget(this);
                this.node.off(cc.Node.EventType.TOUCH_END, this.clickItem, this);
                this.maskNode.off(cc.Node.EventType.TOUCH_END, this.maskNodeEv, this);
            };
            e.prototype.clickItem = function () {
                if ("" != this.tag) {
                    EVUIEffView.emit(EVUIEffView.clickBoxItem, this.tag, this.id, this.typeIndex, this.drakView.active);
                    QAudio.play(QAudio.ui_button);
                }
            };
            e.prototype.setQualityData = function (t) {
                SpriteView.setQualityBgLineColor(t, this.bgLine.node);
                SpriteView.setQualityBgColor(t, this.bgSprite.node);
                var e = SpriteView.getQualityData(t);
                if (e) {
                    var o = e.star_num || 0;
                    this.starListCom.setStarCount(o, e.star_path);
                }
            };
            n([l(cc.Sprite)], e.prototype, "iconSprite", void 0);
            n([l(cc.Sprite)], e.prototype, "bgLine", void 0);
            n([l(cc.Sprite)], e.prototype, "bgSprite", void 0);
            n([l(cc.Label)], e.prototype, "levelLab", void 0);
            n([l(cc.Node)], e.prototype, "maskNode", void 0);
            n([l(cc.Node)], e.prototype, "redNode", void 0);
            n([l(cc.Node)], e.prototype, "wearNode", void 0);
            n([l(cc.Node)], e.prototype, "drakView", void 0);
            n([l(r.default)], e.prototype, "nodeKindItem", void 0);
            n([l(s.default)], e.prototype, "starListCom", void 0);
            return n([p], e);
        })(cc.Component));
o.default = d;
